#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
using namespace std;
int main()
{
    vector<int> vi{1, 3, 5, 7, 9};
    array<double, 4> ad{2.0, 4.0, 6.0, 8.0};
    cout << "vi=";
    for (int i : vi)
        cout << i << " ";
    cout << endl;
    cout << "ad=";
    for (double i : ad)
        cout << i << " ";
    cout << endl;

    vector<double> vr{11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222, 333};
    cout << "vr:";
    for (double i : vr)
        cout << i << " ";
    cout << endl;
    auto it = merge(vi.begin(), vi.end(), ad.begin(), ad.end(), vr.begin());
    cout << "after merge(vi.begin(),vi.end(),ad.begin(),ad.end(),vr.begin())\nvr=";
    for (double i : vr)
        cout << i << " ";
    cout << endl;

    if (it == vr.end())
        cout << "merge(vi.begin(),vi.end(),ad.begin(),ad.end(),vr)=vr.end()!" << endl;
    else
        cout << "it=" << *it << endl;

    return 0;
}